package com.andkrup.easygame.externalmodules {
	import flash.events.IEventDispatcher;	

	/**
	 * @author Andkrup
	 * 
	 * An ExternalModule is a code-box that the Main application trusts with the
	 * task to do something with som data.
	 * 
	 * By loading and initiating an ExternalModule, the Main application is told
	 * in what context the ExternalModule should be delegated tasks
	 */
	public interface ExternalModule extends IEventDispatcher {
		/**
		 * The name of the module
		 */
		function get name():String;
		/**
		 * Get the GameEngine to interface with this module
		 */
		function init(container:ExternalModuleContainer):void;
		/**
		 * Force the Module to reset all data
		 */
		function reset():void;
		/**
		 * Returns a list of hooks
		 */
//		function getMethods():Array;
//		/**
//		 * Return the context in which this external module may be used
//		 */
//		function getContext():String;
//		/**
//		 * Give this module some data and wait for the module to signal that the
//		 * module is finished changing the data
//		 */
//		function checkIn(object:*):void;
//		/**
//		 * Get the data that has been changed by the module
//		 */
//		function checkOut():*;
		
		function kill():void;
		/**
		 * Must return true
		 */
		function call(methodName:String, ...args):ExternalModuleAccept;
	}
}
